<!--{template common/header}-->

<div class="bz-header">
	<div class="bz-header-left">
		<a href="javascript:history.back();" class="iconfont icon-fanhui"><em>{lang return}</em></a>
	</div>
	<h2><!--{eval echo strip_tags($_G['forum']['name']) ? strip_tags($_G['forum']['name']) : $_G['forum']['name'];}--></h2>
	<div class="bz-header-right">
		<a href="portal.php?mod=index&mobile=2" class="iconfont icon-home"></a>
		<!--{eval}-->
		if($_G['uid']){$favfids = C::t('home_favorite')->fetch_all_by_uid_idtype($_G['uid'], 'fid');foreach($favfids as $val){if($val['id'] == $_G[fid]){$isFav = $val['favid'];}}}
		<!--{/eval}-->
		<!--{if $isFav}-->
		<!--{else}-->
		<a id="a_favorite" href="home.php?mod=spacecp&ac=favorite&type=forum&id=$_G[fid]&handlekey=favoriteforum&formhash={FORMHASH}" class="forum-fav iconfont icon-shoucang"></a>
		<!--{/if}-->
	</div>
</div>
<div class="banzhuan-top"></div>

<!--{hook/forumdisplay_top_mobile}-->

<div class="th">
	<!--{if CURMODULE != 'guide'}-->
	<div class="tf bz-fd-appl3 bz-bg-fff">
		<ul>
			<!--{if $_GET['specialtype'] == 'reward'}-->
			<!--{/if}-->

			<li>
				<a href="forum.php?mod=forumdisplay&fid=$_G[fid]&filter=lastpost&orderby=lastpost$forumdisplayadd[lastpost]{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" class="xi2{if $_GET['filter'] == 'lastpost'} xw1{/if}">{lang latest}</a>
			</li>
			<li>
				<a href="forum.php?mod=forumdisplay&fid=$_G[fid]&filter=heat&orderby=heats$forumdisplayadd[heat]{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" class="xi2{if $_GET['filter'] == 'heat'} xw1{/if}">{lang order_heats}</a>
			</li>
			<li>
				<a href="forum.php?mod=forumdisplay&fid=$_G[fid]&filter=digest&digest=1$forumdisplayadd[digest]{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" class="xi2{if $_GET['filter'] == 'digest'} xw1{/if}">{lang digest_posts}</a>
			</li>

			<!--{if empty($_G['forum']['picstyle']) && $_GET['orderby'] == 'lastpost' && (!$_G['setting']['forumseparator'] || !$separatepos) && !$_GET['filter']}-->
			<!--{/if}-->
			<!--{if $_GET['filter'] == 'hot'}-->
			<!--{/if}-->

			<!--{hook/forumdisplay_filter_extra}-->
		</ul>
	</div>
	<!--{else}-->
	<!--{/if}-->
	<!--{if empty($_G['forum']['picstyle'])}-->
	<!--{if CURMODULE == 'guide'}-->
	<!--{/if}-->
	<!--{else}-->
	<!--{/if}-->
</div>

<div class="bz-b-nava-ziban">
	<div class="bgDiv"></div>
	<div class="downNav">
		<div class="downNav-cancel">
			<a href="portal.php?mod=index&mobile=2">{lang return}{lang homepage}</a>
			<!--{if empty($_G['forum']['picstyle'])}-->
			<!--{else}-->
			<a{if empty($_G[ 'cookie'][ 'forumdefstyle'])} href="forum.php?mod=forumdisplay&fid=$_G[fid]&forumdefstyle=yes" class="chked iconfont icon-kaiguan-kai color-f60" {else} href="forum.php?mod=forumdisplay&fid=$_G[fid]&forumdefstyle=no" class="unchk iconfont icon-kaiguan-guan color-b" {/if} style="font-size: 12px;">&nbsp;{lang view_thread_imagemode}</a>
			<!--{/if}-->		
		</div>
		<div style="height: 5px; background: #F6F6F6; width: 100%;"></div>
		<div class="downNav-list">
			<!--{if $sublist > 0}-->
	 			<!--{loop $sublist $sub}-->
					<a href="forum.php?mod=forumdisplay&fid={$sub[fid]}">{$sub['name']}</a>
				<!--{/loop}-->
			<!--{else}-->
			    	<div class="bznodata">
					<p class="iconfont icon-quxiaoguanzhu color-b" style="font-size: 50px;"></p>
					<p class="color-b">{lang forum_subforums}</p>
				</div>
			<!--{/if}-->
		</div>
	</div>
</div>

<!-- main threadlist start -->
<!--{if !$subforumonly}-->

    <!--{if empty($_G['forum']['picstyle'])}-->
			<div class="banzhuan-list">
				<ul>
					<!--{if $_G['forum_threadcount']}-->
					<!--{loop $_G['forum_threadlist'] $key $thread}-->
			
					<!--{eval $tbid = DB::result(DB::query("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE `tid`= '$thread[tid]'"));}-->
					<!--{if $tbid}-->
					<!--{eval $picount = DB::fetch_all("SELECT aid FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1;");}-->
					<!--{eval $picnum = count($picount);}-->
					<!--{if $picnum < 3}-->
					<!--{eval $litpicnum = '1';}-->
					<!--{elseif $picnum > 2 && $picnum < 6}-->
					<!--{eval $litpicnum = '3';}-->
					<!--{elseif $picnum > 5}-->
					<!--{eval $litpicnum = '3';}-->
					<!--{/if}-->
					<!--{eval $covers = DB::fetch_all("SELECT attachment,aid,description FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1 LIMIT 0,$litpicnum;");}-->
					<!--{/if}-->
			
					<!--{if !$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0}-->
					{eval continue;}
					<!--{/if}-->
					<!--{if $thread['displayorder'] > 0 && !$displayorder_thread}-->
					{eval $displayorder_thread = 1;}
					<!--{/if}-->
					<!--{if $thread['moved']}-->
					<!--{eval $thread[tid]=$thread[closed];}-->
					<!--{/if}-->
					
					<li class="cl banzhuan-card">
						<!--{hook/forumdisplay_thread_mobile $key}-->
						<h1>
							<a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" $thread[highlight]>{$thread[subject]}</a>
						</h1>
						<!--{if $tbid}-->
						<div class="post-bottom-three">			
								<!--{if $litpicnum == 1}-->	
								<!--{loop $covers $thecover}-->
								<a href="forum.php?mod=viewthread&tid=$thread[tid]" title="$thecover[aid]"><img src="data/attachment/forum/$thecover['attachment']" /></a>
								<!--{/loop}-->
								<!--{/if}-->	
								<!--{if $litpicnum == 3}-->
								<!--{loop $covers $thecover}-->
								<a href="forum.php?mod=viewthread&tid=$thread[tid]" title="$thecover[aid]"><img src="data/attachment/forum/$thecover['attachment']" /></a>
								<!--{/loop}-->
								<!--{/if}-->		
						</div>
						<!--{/if}-->
						<div class="post-bottom">
							<!--{if $tbid && !$picnum == 0}-->
							<em class="color-b iconfont icon-picfill">&nbsp;<!--{$picnum}-->&nbsp;</em>
							<!--{/if}-->
							<em class="iconfont icon-attention color-b">&nbsp;{$thread[views]}</em>
					        <em class="iconfont icon-xiaoxi color-b">&nbsp;{$thread[replies]}</em>    
						    <em class="color-b">$thread[author]</em>
							<!--{if in_array($thread['displayorder'], array(1, 2, 3, 4))}-->
						        <span class="iconfont icon-ding color-zhiding"></span>
						        <!--{elseif $thread['digest'] > 0}-->
						        <span class="iconfont icon-jing color-jinghua"></span>
						        <!--{elseif $thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
					        <!--{/if}-->			     
					  </div>
					</li>
					<div class="banzhuan-clear"></div>
					<!--{/loop}-->
			
					<!--{else}-->
					<li class="bz-p10" style="text-align: center;">
						<p class="iconfont icon-quxiaoguanzhu color-b" style="font-size: 50px;"></p>
						<p class="color-b">{lang forum_nothreads}</p>
					</li>
					<!--{/if}-->
				</ul>
			</div>
			<div class="banzhuan-clear"></div>
			$multipage
    <!--{else}-->
	    <!--{if empty($_G['cookie']['forumdefstyle'])}-->
		    <div class="bzwaterfall">
				<ul class="cl">
					<!--{loop $_G['forum_threadlist'] $key $thread}-->
					<li class="bz-bg-fff">
						<div class="bz-p10">
							<div class="c cl">
								<a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra" {if $thread[ 'isgroup']==1 || $thread[ 'forumstick'] || CURMODULE=='guide' } {else} onclick="atarget(this)" {/if} title="$thread[subject]" class="z">
									<!--{if $thread['cover']}-->
									<img src="$thread[coverpath]" alt="$thread[subject]"/>
									<!--{else}-->
									<span class="nopic" style="width:100%; height:110px;"></span>
									<!--{/if}-->
								</a>
							</div>
							<div class="auth cl">
								<cite class="xg1 y">
									<a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" title="$thread[replies] {lang reply}" class="color-b"><em class="iconfont icon-xiaoxi color-b"></em>&nbsp;$thread[replies]</a>
								</cite>
								<!--{if $thread['authorid'] && $thread['author']}-->
								<a href="home.php?mod=space&uid=$thread[authorid]" class="color-b">$thread[author]</a>
								<!--{if !empty($verify[$thread['authorid']])}-->$verify[$thread[authorid]]
								<!--{/if}-->
								<!--{else}-->
								$_G[setting][anonymoustext]
								<!--{/if}-->
							</div>
						</div>
					</li>
					<!--{/loop}-->
				</ul>
		    </div>
			<div class="banzhuan-clear"></div>
			$multipage
		<!--{else}-->
			<div class="banzhuan-list">
				<ul>
					<!--{if $_G['forum_threadcount']}-->
					<!--{loop $_G['forum_threadlist'] $key $thread}-->
			
					<!--{eval $tbid = DB::result(DB::query("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE `tid`= '$thread[tid]'"));}-->
					<!--{if $tbid}-->
					<!--{eval $picount = DB::fetch_all("SELECT aid FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1;");}-->
					<!--{eval $picnum = count($picount);}-->
					<!--{if $picnum < 3}-->
					<!--{eval $litpicnum = '1';}-->
					<!--{elseif $picnum > 2 && $picnum < 6}-->
					<!--{eval $litpicnum = '3';}-->
					<!--{elseif $picnum > 5}-->
					<!--{eval $litpicnum = '3';}-->
					<!--{/if}-->
					<!--{eval $covers = DB::fetch_all("SELECT attachment,aid,description FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1 LIMIT 0,$litpicnum;");}-->
					<!--{/if}-->
			
					<!--{if !$_G['setting']['mobile']['mobiledisplayorder3'] && $thread['displayorder'] > 0}-->
					{eval continue;}
					<!--{/if}-->
					<!--{if $thread['displayorder'] > 0 && !$displayorder_thread}-->
					{eval $displayorder_thread = 1;}
					<!--{/if}-->
					<!--{if $thread['moved']}-->
					<!--{eval $thread[tid]=$thread[closed];}-->
					<!--{/if}-->
					
					<li class="cl banzhuan-card">
						<!--{hook/forumdisplay_thread_mobile $key}-->
						<h1>
							<a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" $thread[highlight]>{$thread[subject]}</a>
						</h1>
						<!--{if $tbid}-->
						<div class="post-bottom-three">			
								<!--{if $litpicnum == 1}-->	
								<!--{loop $covers $thecover}-->
								<a href="forum.php?mod=viewthread&tid=$thread[tid]" title="$thecover[aid]"><img src="data/attachment/forum/$thecover['attachment']" /></a>
								<!--{/loop}-->
								<!--{/if}-->	
								<!--{if $litpicnum == 3}-->
								<!--{loop $covers $thecover}-->
								<a href="forum.php?mod=viewthread&tid=$thread[tid]" title="$thecover[aid]"><img src="data/attachment/forum/$thecover['attachment']" /></a>
								<!--{/loop}-->
								<!--{/if}-->		
						</div>
						<!--{/if}-->
						<div class="post-bottom">
							<!--{if $tbid && !$picnum == 0}-->&nbsp;<em class="color-b iconfont icon-picfill">&nbsp;<!--{$picnum}-->&nbsp;</em><!--{/if}-->
							<em class="iconfont icon-attention color-b">&nbsp;{$thread[views]}</em>
					        <em class="iconfont icon-xiaoxi color-b">&nbsp;{$thread[replies]}</em>    
						    <em class="color-b">$thread[author]</em>
							<!--{if in_array($thread['displayorder'], array(1, 2, 3, 4))}-->
						        <span class="iconfont icon-ding color-zhiding"></span>
						        <!--{elseif $thread['digest'] > 0}-->
						        <span class="iconfont icon-jing color-jinghua"></span>
						        <!--{elseif $thread['attachment'] == 2 && $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
					        <!--{/if}-->			     
					  </div>
					</li>
					<div class="banzhuan-clear"></div>
					<!--{/loop}-->
			
					<!--{else}-->
					<li class="bz-p10" style="text-align: center;">
						<p class="iconfont icon-quxiaoguanzhu color-b" style="font-size: 50px;"></p>
						<p class="color-b">{lang forum_nothreads}</p>
					</li>
					<!--{/if}-->
				</ul>
			</div>
			<div class="banzhuan-clear"></div>
			$multipage
		<!--{/if}-->
	<!--{/if}-->
	
<!--{/if}-->
<!-- main threadlist end -->

<!--{hook/forumdisplay_bottom_mobile}-->
<div class="pullrefresh" style="display:none;"></div>

<script type="text/javascript">
	$('.forum-fav').on('click', function() {
		var obj = $(this);
		$.ajax({
			type:'POST',
			url:obj.attr('href') + '&handlekey=forum-fav&inajax=1',
			data:{'favoritesubmit':'true', 'formhash':'{FORMHASH}'},
			dataType:'xml',
		})
		.success(function(s) {
			popup.open(s.lastChild.firstChild.nodeValue);
			evalscript(s.lastChild.firstChild.nodeValue);
		})
		.error(function() {
			window.location.href = obj.attr('href');
			popup.close();
		});
		return false;
	});
</script>
<div class="banzhuan-bottom"></div>
<!--{hook/global_footer_mobile}-->
<!--{eval $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);$clienturl = ''}-->
<!--{if strpos($useragent, 'iphone') !== false || strpos($useragent, 'ios') !== false}-->
<!--{eval $clienturl = $_G['cache']['mobileoem_data']['iframeUrl'] ? $_G['cache']['mobileoem_data']['iframeUrl'].'&platform=ios' : 'http://www.discuz.net/mobile.php?platform=ios';}-->
<!--{elseif strpos($useragent, 'android') !== false}-->
<!--{eval $clienturl = $_G['cache']['mobileoem_data']['iframeUrl'] ? $_G['cache']['mobileoem_data']['iframeUrl'].'&platform=android' : 'http://www.discuz.net/mobile.php?platform=android';}-->
<!--{elseif strpos($useragent, 'windows phone') !== false}-->
<!--{eval $clienturl = $_G['cache']['mobileoem_data']['iframeUrl'] ? $_G['cache']['mobileoem_data']['iframeUrl'].'&platform=windowsphone' : 'http://www.discuz.net/mobile.php?platform=windowsphone';}-->
<!--{/if}-->
<div id="mask" style="display:none;"></div>
<!--{if !$nofooter}-->
<!--{/if}-->
<a class="bz-ziban bzdown"><i class="iconfont icon-more"></i></a>
<a href="<!--{if $_GET['mod'] == 'forumdisplay' || $_GET['mod'] == 'viewthread'}-->forum.php?mod=post&action=newthread&fid=$_G['fid']<!--{else}-->forum.php?mod=misc&action=nav<!--{/if}-->" class="bz-fatie"><i class="iconfont icon-fatie"></i></a>
<div class="banzhuan-clear"></div>
</body>
</html>
<!--{eval updatesession();}-->
<!--{if defined('IN_MOBILE')}-->
	<!--{eval output();}-->
<!--{else}-->
	<!--{eval output_preview();}-->
<!--{/if}-->